#include <bits/stdc++.h>
using namespace std;

int n;
const int N = 1e7 + 10;
int a[N];

int main() {
    cin >> n;
    int cnt = 0;
    while(n > 0) {
        if((n - 2) & 1) 
            a[++cnt] = 3, n -= 3;
        else
            a[++cnt] = 2, n -= 2;
    }
    cout << cnt << endl;
    for(int i = 1; i <= cnt; i ++) {
        cout << a[i] << " ";
    }
}